import Vue from 'vue'
import Router from 'vue-router'
import index from '@/views/index'
import wxInvoiceList from '@/views/wxInvoiceList'
import addManual from '@/views/addManual'
import myInvoice from '@/views/myInvoice'
import addScanBill from '@/views/addScanBill'
import invoiceDetail from '@/views/invoiceDetail'
// Router.prototype.goBack = function () {
//   this.isBack = true
//   window.history.go(-1)
// }
Vue.use(Router)

export default new Router({
  // mode: 'history',
  routes: [
    {
      path: '/',
      name: '发票包',
      component: index
    },
    {
      path: '/wxInvoiceList',
      name: '微信发票',
      component: wxInvoiceList
    },
    {
      path: '/addManual',
      name: '手工录入',
      component: addManual
    },
    {
      path: '/addScanBill',
      name: '扫码录入',
      component: addScanBill
    }, {
      path: '/myInvoice',
      name: '我的发票',
      component: myInvoice,
      children: [{
        path: 'invoiceDetail',
        name: '发票详情',
        component: invoiceDetail
      }]
    }
  ]
})
